#include "HttpClient.h"
#include "NetHelper.h"
#include <stdio.h>
#include <string>
#include <stdlib.h>
using namespace std;

int main(int argc, char *argv[])
{
	NetworkStartup();
	HttpClient aClient;
	string server = argv[1];
	int port = strtol(argv[2], 0, 10);
	string uri = argv[3];
	int retval = aClient.SetServer(server,port,0,port==443);
	printf("set server: retval=[%d]\n", retval);
	if(retval == 0) {
		aClient.SetUri(uri);
		aClient.SetMethod(METHOD_GET);
		aClient.SendRequest();

		int status = aClient.QueryStatusCode();
		//printf("status: %d\n", status);
	}
	NetworkCleanup();
	return 0;
}